package de.l3s.forgetit.services.schema;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import static com.google.common.base.Preconditions.checkNotNull;

@XmlType
public class MetaData {

	private List<Pair> pairs;
	
	@XmlElement(name = "meta")
	public List<Pair> getMetaData() {
		return pairs;
	}
	
	public MetaData() {
		pairs = new ArrayList<Pair>();
	}
	
	public void addPair(Pair p) {		
		checkNotNull(pairs);
		pairs.add(p);
	}
	
	public void addPair(String k, String v) {
		checkNotNull(pairs);
		Pair p = new Pair(k, v);
		pairs.add(p);
	}
}
